﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>修改密码</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="/style/admin/style/adminStyle.css" rel="stylesheet" type="text/css" />
        <script src="/style/admin/js/jquery.js"></script>
    </head>
    <body>
        <div class="wrap">
            <div class="page-title">
                <span class="modular fl"><i class="user"></i><em>修改密码</em></span>
            </div>
            <form action="" id="formAdd" onsubmit="return false">
                <table class="noborder">
                    <tr>
                        <td width="15%" style="text-align:right;">用户名：</td>
                        <td><input type="text" name="name" class="textBox length-middle"/>&nbsp;<span id="NameErrorInfo"></span></td>
                    </tr> 
                 <!--   <tr>
                     <td style="text-align:right;">旧密码：</td>
                     <td><input type="password" class="textBox length-middle"/></td>
                    </tr>-->
                    <tr>
                        <td style="text-align:right;">密码：</td>
                        <td><input type="password" name="pass" class="textBox length-middle"/>&nbsp;<span id="PassErrorInfo"></span></td> 
                    </tr>
                    <tr>
                        <td style="text-align:right;">确认密码：</td>
                        <td><input type="password" name="repass" class="textBox length-middle"/></td>
                    </tr>
                    <tr>
                        <td style="text-align:left;"></td>
                        <td><input type="checkbox" name='status' value="0" checked/>正常 
                            <input type="checkbox" name="status" value="1" />禁用
                        </td> 
                    </tr> 
                    <tr>
                        <td style="text-align:right;"></td>
                        <td><input type="submit" onclick="add()" class="tdBtn" value="保存"/></td>
                    </tr>
                </table>
            </form>
        </div>
        <script>
                function add(){
                    str=$("#formAdd").serialize();
                    $.post('/admin/admin',{str:str,'_token':'{{csrf_token()}}'},function(data){
                         if(data==1){
                             window.location.href='/admin/admin';
                         }else{ 
                             var str='';
                             if(data.name){
                                 str='*'+data.name;
                                 $("#NameErrorInfo").text(str);
                                 $("#NameErrorInfo").css('color',"red");
                             }else{
                                 str='√';
                                 $("#NameErrorInfo").text(str);
                                 $("#NameErrorInfo").css('color',"green");
                             } 
                              if(data.pass){
                                 str='*'+data.pass;
                                 $("#PassErrorInfo").text(str);
                                 $("#PassErrorInfo").css('color',"red");
                             }else{
                                 str='√';
                                 $("#PassErrorInfo").text(str);
                                 $("#PassErrorInfo").css('color',"green");
                             }
                         }  
                         
                    })
                }   
               
        </script>
    </body>
</html>